<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.lable.drugqualityspecSeeStd"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
                            
    <section class="content-header">
        <h1>配送企业药品</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
                <li><a href="#">统计查询</a></li>
                <li><a href="#">配送企业药品</a></li>
        </ol>
    </section>
        
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
             <form  id="form" method="post">
                <div class="input">
                <div class="textalign1">地区：</div>
                    <div class="textalign">季度<spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                    		<table style="width:100%">
                    			<tr>
                    				<td style="width:50%">
                    				<input id="startSea" name="startSea" type="text" onclick="WdatePicker({dateFmt:'yyyy年M季度', isQuarter:true, isShowOK:false,disabledDates:['....-0[5-9]-..','....-1[0-2]-..'], startDate:'%y-01-01' })" class="textinput" readonly="true" />
                    				</td>
                    				<td>&nbsp;-&nbsp;</td>
                    				<td style="width:50%">
                    				<input id="endSea" name="endSea" type="text" onclick="WdatePicker({dateFmt:'yyyy年M季度', isQuarter:true, isShowOK:false,disabledDates:['....-0[5-9]-..','....-1[0-2]-..'], startDate:'%y-01-01' })" class="textinput" readonly="true" />
                    				</td>
                    			</tr>
                    		</table>
                    </div>
                    <div class="textalign1">药品分类<spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                       	<select class="textinput" id='drugCat' name='drugCat' >
                       		<option value='' >请选择</option>
                       		<option value='1' >西药</option>
                       		<option value='2,3' >中药</option>
                       	</select>
                    </div>
                     <div class="textalign" >
                         <button id="selectSpec" type="button" onclick="search();" class="btn btn-success btn-sm"><spring:message code="message.button.seachSpacing"/></button>
                    </div>
                </div>
            </form>
            </div>
          </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
    </section>
      <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
        $(function () {
        	
            $("#gridlist").jqGrid({
                url: "${ctx}/anaDruginfo/getAnaDelByDrugWithSea.html?compCode=${compCode}",
                mtype: "post",
                datatype: "json",
                autowidth: true,
                height: 310,
                colNames: [
                    '季度',
                    '通用名',
                    '药品分类',
                    '采购金额(万)', 
                    '配送金额(万)', 
                    '入库金额(万)',
					'退货金额(万)',
                    '配送率',
					'入库率',
                    '退货率'
                ],
                colModel: [
                    { name: 'date', width: 100, align:"center", sortable: false},
                    { name: 'drug_name', width: 200, align:"center", sortable: false},
                    { name: 'drug_cat', width: 60, align:"center", sortable: false,
                    	formatter:function(val){
							if(val == 1) {
								return "西药";
							}else {
								return "中药";
							}
                    	}
                    },
                    { name: 'total_amount', width: 75, align:"center", sortable: false},
                    { name: 'del_amount', width: 75, align:"center", sortable: false},
                    { name: 'recp_amount', width: 75, align:"center", sortable: false},
					{ name: 'ret_amount', width: 75,hidden:true, align:"center", sortable: false},
                    { name: 'del_ratio', width: 75, align:"center", sortable: false},
                    { name: 'recp_ratio', width: 75, align:"center", sortable: false},
					{ name: 'ret_ratio', width: 75,hidden:true, align:"center", sortable: false}
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: false, 
                viewrecords: true,
                caption: "季度统计列表",
                gridComplete:function(){
                    autoRNWidth("gridlist");
                },
                jsonReader: {
                	 repeatitems: false,
                    id: "qualitySpecId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        function search(page) {
        	var area1 = $.trim($("#area1").val());
            var area2 = $.trim($("#area2").val());
            var area3 = $.trim($("#area3").val());
            var startSea =$.trim($("#startSea").val());
            var endSea =$.trim($("#endSea").val());
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{
                	"area1":area1,
                	"area2":area2,
                	"area3":area3,
                	"startSea":startSea,
                	"endSea":endSea
                },
                page : (page || 1)
            }).trigger("reloadGrid"); //重新载入  
        }
    </script>
</body>
</html> 
                          
                  
                  